﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UtilZ.Dotnet.Ex.Communication.Net.Telnet.KeyCommands
{
    internal abstract class TelnetKeyCommandAbs : ITelnetKeyCommand
    {
        public TelnetKeyCommandAbs()
        {

        }

        public bool Process(ListenTelnetClient telnetClient, byte[] data, int revicedDataLength)
        {
            return this.PrimitveProcess(telnetClient, data, revicedDataLength);
        }

        protected abstract bool PrimitveProcess(ListenTelnetClient telnetClient, byte[] data, int revicedDataLength);


        /// <summary>
        /// 回显
        /// </summary>
        /// <param name="telnetClient"></param>
        /// <param name="data"></param>
        /// <param name="revicedDataLength"></param>
        protected void SendEcho(ListenTelnetClient telnetClient, byte[] data, int revicedDataLength)
        {
            telnetClient.Send(data, 0, revicedDataLength);
        }
    }
}
